@extends("admin.layouts.main")  
<style>
    .my-ver-align{  vertical-align: -2px;}
    .btn-link{color:gray;}
    .table{font-size:14px;}
</style>
@section("content")
<div class="container-fiuld p-3">
    <div class="card">
		<div class="card-body">
			<div class="row mt-3 mb-3">
				<div class="col-lg-12">
					<form class="form-inline">
						<label>公会：</label>
						<select id="guild" class="form-control" naem="guild">
                            <option value="">全部</option>							
							@foreach($guildlist as $v)
                            <option value="{{$v['id']}}" @if($guild == $v['id']) selected @endif>{{$v['username']}}</option>
							@endforeach
                        </select>
						<label class="ml-3">主播ID/主播昵称:</label>
                        <input type="text" class="ml-4 mr-5 form-control" name="keyword" id="keyword" value="{{$keyword}}" placeholder="请选择">
						<label for="stime">时间：</label>
                        <input type="text" name="time_value" class="layui-input test-laydate-item form-control mr-3" style="border-color:#ced4da" id="stime" value="{{$time_value}}" placeholder="开始时间" lay-key="1">
						<a class="btn btn-primary ml-1 mr-3 search text-white">查询</a>
                        <button type="reset" class="btn btn-secondary">重置</button>
					</form>
				</div>
			</div>
			<div class="row">
				<div class="col-lg-12">
					<table class="table">
						<thead class="thead-light">
							<tr class="text-dark">
								<th>时间（天）</th>
								<th>主播ID/昵称</th>
								<th>收益金额</th>
								<th>所属公会</th>
							</tr>
						</thead>
						<tbody>
							@foreach($income as $v)
							<tr>
								<td>{{$v['date']}}</td>
								<td>{{$v['owner_id'] }}/{{ $v['name'] }}</td>
								<td>{{$v['sum_amount']}}</td>
								<td>{{$v['title']}}</td>
							</tr>
							@endforeach
						</tbody>
					</table>
				</div>
			</div>
		</div>
		<div style="text-align: right;">
		@if(!empty($income))
		{{ $income->links('admin.layouts.paginate') }}
		@endif;
		</div>
    </div>
</div>
@endsection
@section("js")
<script type="text/javascript">
    layui.use(['form', 'ori', "laydate"], function () {
        var form = layui.form,
            ori = layui.ori,
            dialog = layui.dialog,
            $ = layui.$
        laydate = layui.laydate;
        var time_value = '';
        lay('.test-laydate-item').each(function () {
            laydate.render({
                elem: this
                , trigger: 'click'
            });
        });
        $('.search').click(function () {
			var guild = $("#guild").val();
            var keyword = $("#keyword").val();
			var time_value = $("#stime").val();
            location.href = "{{ route('draw.income') }}" +'?guild='+guild+'&keyword=' +keyword+'&time_value='+ time_value;
        });
		//重置功能调用的方法
        ori.reset("[type=reset]");
    });
</script>
@endsection
